package com.me.Design;

import com.me.dao.foot.Drink.impl.Pepsi;
import com.me.dao.foot.FootBuilder;
import com.me.dao.foot.Meal;

/**
 * 功能：建造者模式（Builder Pattern）使用多个简单的对象一步一步构建成一个复杂的对象
 *
 * @author：dongshibo(F_baisi)
 * @create：2019/1/25/025 16:57
 * @version：2019 Version：1.0
 * @company：老屋新房 Created with IntelliJ IDEA
 */
public class BuilderDesignTest {
	public static void main(String[] args) {
		//新建食物套餐对象
		FootBuilder footBuilder = new FootBuilder();
		//获取肉套餐
		Meal perpareChicken = footBuilder.perpareChicken();
		//输出价格 以及套餐列表
		System.out.println(perpareChicken.getCost());
		perpareChicken.showItems();
		//套餐加入新食物
		perpareChicken.addFoot(new Pepsi());
		System.out.println(perpareChicken.getCost());
		perpareChicken.showItems();
		Meal prepareVagMeal = footBuilder.prepareVagMeal();
		System.out.println(prepareVagMeal.getCost());
		prepareVagMeal.showItems();
	}
}
